﻿Imports System.Net

Namespace UDPBroadcast

    Public Class ServerErrorEventArgs
        Inherits EventArgs

        Public Property e() As Exception

        Public Sub New(ByVal ex As Exception)
            Me.e = ex
        End Sub

    End Class

    Public Class ServerDataReceiveEventArgs
        Inherits EventArgs

        Private m_RemoteEP As IPEndPoint
        Private m_Data As Byte()
        Private m_MessageType As MessageType

        Public Sub New(remoteEP As IPEndPoint, data As Byte())
            Me.RemoteEP = remoteEP
            Me.Data = data
            Me.MessageType = MessagePackageBase.GetMessageType(data)
        End Sub

        Public Property RemoteEP() As IPEndPoint
            Get
                Return m_RemoteEP
            End Get
            Private Set(value As IPEndPoint)
                m_RemoteEP = value
            End Set
        End Property

        Public Property Data() As Byte()
            Get
                Return m_Data
            End Get
            Private Set(value As Byte())
                m_Data = value
            End Set
        End Property

        Public Property MessageType() As MessageType
            Get
                Return m_MessageType
            End Get
            Private Set(value As MessageType)
                m_MessageType = value
            End Set
        End Property

    End Class

End Namespace